! function (window) {
  // 获取token信息和参数
  function getToken() {
    var uuid = GetQueryString('uuid');
    var customerUid = GetQueryString('customerUid');
    var accessToken = GetQueryString('accessToken');
    var deviceno = GetQueryString('deviceno');
    var versionCode = GetQueryString('version-code');
    var packageName = GetQueryString('packageName');
    var mobileOs = GetQueryString('mobileOs');
    var params = '?accessToken=' + accessToken + '&deviceno=' + deviceno + '&versionCode=' + versionCode + '&packageName=' + packageName + '&mobileOs=' + mobileOs + '&uuid=' + uuid + '&customerUid=' + customerUid;
  }
  //获取url参数
  function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
  }

  //强制补位0
  function toDecimal2(x) {
    var f = parseFloat(x);
    if (isNaN(f)) {
      return false;
    }
    var f = Math.round(x * 100) / 100;
    var s = f.toString();
    var rs = s.indexOf('.');
    if (rs < 0) {
      rs = s.length;
      s += '.';
    }
    while (s.length <= rs + 2) {
      s += '0';
    }
    return s;
  }
  //千分位分割 n为字符串
  function comdify(n) {
    var re = /\d{1,3}(?=(\d{3})+$)/g;
    var n1 = n.replace(/^(\d+)((\.\d+)?)$/, function (s, s1, s2) {
      return s1.replace(re, "$&,") + s2;
    });
    return n1;
  }
  //js转换时间戳
  function getDate(inputTime, style) {
    var date = new Date(inputTime);
    var Y = date.getFullYear() + style;
    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + style;
    var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
    var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
    var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
    var s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
    return {
      YMD: Y + M + D,
      YMDhms: Y + M + D + '  ' + h + m + s,
      ymd: Y + '年' + M + '月' + D + '日'
    };
  }
  window.getToken = getToken;
  window.GetQueryString = GetQueryString;
  window.toDecimal2 = toDecimal2;
  window.comdify = comdify;
  window.getDate = getDate;
}(window);